/*
 * PopulationCenter.java
 *
 * Version 1.0
 * Copyright 2011 BobSoft Inc
 */
package edu.gatech.galaxy.model;

import java.util.HashMap;
import java.util.Map;

import edu.gatech.galaxy.model.types.MeterType;

/**
 * @author Robert
 * @version 1.0
 *
 */
public class PopulationCenter {
  private double allocatedFood;
  private String speciesName;
  private Map<MeterType, Meter> meters = new HashMap<MeterType, Meter>();
  
  /**
   * 
   * Makes a new PopulationCenter
   */
  public PopulationCenter() {
      this("");    
  }
  
  public PopulationCenter(String species) {
      speciesName = "";
      allocatedFood = 1.0;
      init();
  }
  
  private void init() {
      addMeter(MeterType.POPULATION);
      addMeter(MeterType.HEALTH);
      addMeter(MeterType.TARGET_HEALTH);
      addMeter(MeterType.FOOD_CONSUMPTION);
  }
  
  private void addMeter(MeterType type) {
      final Meter meter = new Meter();
      meters.put(type, meter);
  }
  
  public Meter getMeter(MeterType type) {
      final Meter meter = meters.get(type);
      return meter;
  }
  
  public double nextTurnPopulationGrowth() {
      return 1.0;
  }
  
  public double nextTurnPopulationGrowthMax() {
      return 1.0;
  }
  
  public double foodAllocationForMaxGrowth() {
      return 1.0;
  }

/**
 * @return the allocatedFood
 */
public double getAllocatedFood() {
    return allocatedFood;
}

/**
 * @param allocatedFood the allocatedFood to set
 */
public void setAllocatedFood(double allocatedFood) {
    this.allocatedFood = allocatedFood;
}

/**
 * @return the speciesName
 */
public String getSpeciesName() {
    return speciesName;
}

/**
 * @param speciesName the speciesName to set
 */
public void setSpeciesName(String speciesName) {
    this.speciesName = speciesName;
}
}
